const { DataTypes } = require('sequelize');
const defineModel = require('@/config/database');
const Model = defineModel('xs_attach', {
	oldName: {
		type: DataTypes.STRING(50),
		comment: '附件旧名称',
		allowNull: true,
		unique: true
	},
	newName: {
		type: DataTypes.STRING(50),
		comment: '附件新名称',
		allowNull: true
	},
	attrType: {
		type: DataTypes.INTEGER(2),
		comment: '附件类型',
		allowNull: true
	},
	attrSize: {
		type: DataTypes.INTEGER,
		comment: '附件大小',
		allowNull: true
	},
	attrSuffix: {
		type: DataTypes.STRING(6),
		comment: '附件后缀',
		allowNull: true,
	},
	attrUrl: {
		type: DataTypes.STRING,
		comment: '附件路径'
	},
	createtime: {
		type: DataTypes.DATE,
		comment: '创建时间'
	},
	updatetime: {
		type: DataTypes.DATE,
		comment: '更新时间'
	}
});
Model.beforeCreate((model, options) => {
	// console.log(model, options);
});
module.exports = Model;